package com.zmn.oms.services.impl.work;

import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.persistence.interfaces.work.OrderWorkAmountDao;
import com.zmn.oms.services.interfaces.work.OrderWorkAmountService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 类描述：工单金额实现类型
 * @author heciqi
 * @date 2018/11/7 14:47
 */
@Service
public class OrderWorkAmountServiceImpl implements OrderWorkAmountService {

	@Resource
	OrderWorkAmountDao orderWorkAmountDao;

	/**
	 * 修改预付款
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updatePrepayAmount(OrderWork orderWork) {
		return orderWorkAmountDao.updatePrepayAmount(orderWork);
	}

	@Override
	public Integer updatePrepayAmountAndMasterAmountPay(OrderWork orderWork) {
		return orderWorkAmountDao.updatePrepayAmountAndMasterAmountPay(orderWork);
	}

	/**
	 * 支付预付款
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updatePrepayAmountPay(OrderWork orderWork) {
		return orderWorkAmountDao.updatePrepayAmountPay(orderWork);
	}

	/**
	 * 修改定金
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updateDepositAmount(OrderWork orderWork) {
		return orderWorkAmountDao.updateDepositAmount(orderWork);
	}

	/**
	 * 支付定金
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updateDepositAmountPay(OrderWork orderWork) {
		return orderWorkAmountDao.updateDepositAmountPay(orderWork);
	}

	/**
	 * 修改工程师收款
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updateMasterAmount(OrderWork orderWork) {
		return orderWorkAmountDao.updateMasterAmount(orderWork);
	}

	/**
	 * 支付工程师收款
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updateMasterAmountPay(OrderWork orderWork) {
		return orderWorkAmountDao.updateMasterAmountPay(orderWork);
	}

	/**
	 * 修改优惠金额
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updateDiscountAmount(OrderWork orderWork) {
		return orderWorkAmountDao.updateDiscountAmount(orderWork);
	}

	/**
	 * 修改退款金额
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updateRefundAmount(OrderWork orderWork) {
		return orderWorkAmountDao.updateRefundAmount(orderWork);
	}

	/**
	 * 更新配件金额
	 * @param orderWork
	 * @return 影响行数
	 */
	@Override
	public Integer updatePartAmount(OrderWork orderWork) {
		return orderWorkAmountDao.updatePartAmount(orderWork);
	}

	@Override
	public void updateAmount(OrderWork orderWork) {
		orderWorkAmountDao.updateAmount(orderWork);
	}

	@Override
	public void updateChannelAmount(OrderWork orderWork) {
		orderWorkAmountDao.updateChannelAmount(orderWork);
	}

	@Override
	public void updatePayStatus(OrderWork orderWork) {
		orderWorkAmountDao.updatePayStatus(orderWork);
	}

	@Override
	public void updateSecondChannelPay(OrderWork updateAmount) {
		orderWorkAmountDao.updateSecondChannelPay(updateAmount);
	}

	@Override
	public void updatePayStatusChannelPrepay(OrderWork updateAmount) {
		orderWorkAmountDao.updatePayStatusChannelPrepay(updateAmount);
	}

    @Override
    public void deleteOriginalAmount(Long orderId, Long workId) {
        orderWorkAmountDao.deleteOriginalAmount(orderId, workId);
    }

	@Override
	public void updateCleanAmount(OrderWork updateAmount, Map<String, Boolean> fields) {
		orderWorkAmountDao.updateCleanAmount(updateAmount, fields);
	}

	@Override
	public void updateOriginalAmountAfterPayment(OrderWork updateOrderWork) {
		orderWorkAmountDao.updateOriginalAmountAfterPayment(updateOrderWork);
	}

	@Override
	public void updateRefund(OrderWork orderWork) {
		orderWorkAmountDao.updateRefund(orderWork);
	}

	@Override
	public void updateOriginalAndTotalAndDepositAmount(OrderWork orderWork) {
		orderWorkAmountDao.updateOriginalAndTotalAndDepositAmount(orderWork);
	}

	@Override
	public void hotfixUpdateRefundAmount(OrderWork upOrderWork) {
		orderWorkAmountDao.hotfixUpdateRefundAmount(upOrderWork);
	}

	@Override
	public void updatePayDiscountAmount(OrderWork upOrderWork) {
		orderWorkAmountDao.updatePayDiscountAmount(upOrderWork);
	}
}
